home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
New Perspectives on Computer Concepts
/
New Perspectives on Computer Concepts.iso
/
np2010c
/
l05a.swf
/
scripts
/
LSuperClass.as
< prev
next >
Wrap
Text File
|
2008-11-25
|
4KB
|
168 lines
_global.LToolBox = function()
{
this.interaction_id = undefined;
this.interaction_type = undefined;
this.correct_response = undefined;
this.student_response = undefined;
this.result = undefined;
this.feedback = undefined;
this.numOfTries = 1;
this.feedback_list = undefined;
this.tracking = undefined;
this.weighting = undefined;
this.objective_id = undefined;
this.latency = undefined;
this.navigation = undefined;
this.buttonLabels = new Array();
};
_global.LToolBox.prototype = new Object();
LToolBox.prototype.setTextField = function(fieldName, val)
{
this.assets_path[fieldName].text = val;
};
LToolBox.prototype.setComponentLabel = function(UIComponent, val)
{
this.assets_path[UIComponent].label = val;
this.assets_path[UIComponent].redraw(true);
};
LToolBox.prototype.setComponentListener = function(UIComponent, val)
{
this.assets_path[UIComponent].clickHandler = val;
};
LToolBox.prototype.setComponentState = function(UIComponent, val)
{
this.assets_path[UIComponent].enabled = val;
};
LToolBox.prototype.getComponentLabel = function(UIComponent)
{
return this.assets_path[UIComponent].label;
};
LToolBox.prototype.setRadioGroupName = function(UIComponent, val)
{
this.assets_path[UIComponent].groupName = val;
};
LToolBox.prototype.initControlButton = function(eventHandler)
{
if(this.feedback == true)
{
this.label_state = this.buttonLabels[1];
if(this.navigation == 2)
{
this.navigation = 1;
}
}
else if(this.tracking == true)
{
this.label_state = this.buttonLabels[2];
}
else if(this.navigation != 0)
{
this.label_state = this.buttonLabels[3];
if(this.navigation == 2)
{
this.navigation = 1;
}
}
else
{
this.label_state = this.buttonLabels[0];
}
this.setComponentLabel(this.Assets.ControlButton,this.label_state);
this.setComponentState(this.Assets.ControlButton,false);
this.setComponentListener(this.Assets.ControlButton,eventHandler);
};
LToolBox.prototype.setFeedback = function(val)
{
if(this.feedback == true)
{
var _loc2_ = this.Assets.FeedbackField;
var _loc4_ = this.Assets.ControlButton;
if(val == 0)
{
this.setTextField(_loc2_,this.feedback_list[0]);
}
else if(val == 1)
{
var _loc5_ = this.getComponentLabel(_loc4_);
this.setTextField(_loc2_,this.feedback_list[3]);
}
else if(val == 2)
{
this.setTextField(_loc2_,this.feedback_list[1]);
}
else if(val == 3)
{
if(this.numOfTries > 1)
{
this.setTextField(_loc2_,this.feedback_list[4]);
}
else
{
this.setTextField(_loc2_,this.feedback_list[2]);
}
}
else if(val == 4)
{
this.setTextField(_loc2_,this.feedback_list[4]);
}
}
};
LToolBox.prototype.setNavigation = function()
{
if(this.navigation == 0)
{
this.setComponentState(this.Assets.ControlButton,false);
}
else if(this.navigation == 1)
{
if(!this.buttonFlag || this.buttonFlag == false)
{
this.setComponentLabel(this.Assets.ControlButton,this.buttonLabels[3]);
this.buttonFlag = true;
}
else if(this.navAction == false)
{
if(!this.navLabel)
{
this.assets_path.nextFrame();
}
else
{
this.assets_path.gotoAndStop(this.navLabel);
}
}
else if(this.navAction == true)
{
if(!this.navLabel)
{
this.assets_path.gotoAndPlay(this._currentframe + 1);
}
else
{
this.assets_path.gotoAndPlay(this.navLabel);
}
}
}
else if(this.navigation == 2)
{
this.assets_path.nextFrame();
}
};
LToolBox.prototype.submitScore = function()
{
if(this.weighting <= 0 || this.weighting == undefined)
{
this.weighting = 1;
}
var _loc2_ = undefined;
if(this.result == "C")
{
_loc2_ = this.weighting;
}
else if(this.result == "W")
{
_loc2_ = -1 * this.weighting;
}
QuizTrack.countScore(_loc2_);
};